/*******************************************************************************
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
function validteCode()
{
    var codes = new Array(4);       //用于存储随机验证码
    //var colors = new Array("Red","Green","Gray","Blue","Maroon","Aqua","Fuchsia","Lime","Olive","Silver");
	//var colors = new Array("#2F64A8");
    for(var i=0;i < codes.length;i++)
    {//获取随机验证码
        codes[i] = Math.floor(Math.random()*10);
    }
	
    var spans = document.getElementById("divCode").childNodes;
    for(var i=0;i < spans.length;i++)
    {
        spans[i].innerHTML=codes[i];
     // spans[i].style.color = colors[Math.floor(Math.random()*10)];    随机设置验证码颜色
        
    }
 
}
document.onload = validteCode();